home *** CD-ROM | disk | FTP | other *** search
/ c't freeware shareware 1997 / CT_SW_97.ISO / pc / software / kommunik / macos / hotlc68k.hqx / hotlc68k / Custom Toolbars / Making Custom Toolbars < prev    next >
Text File  |  1997-02-09  |  6KB  |  103 lines

  1. Making Custom Toolbars For Hotline
  2.  
  3. A custom toolbar is a "Toolbar" file that you put in the same folder as the Hotline client, and when you start it up, the standard toolbar is gone and replaced with your too cool 3D toolbar or whatever.  To make your own toolbar, you'll need ResEdit, Resorcerer, or similiar and something to make the pictures in.
  4.  
  5. Toolbar files must be named "Toolbar", and must have the creator code set to "HTLC" and the type code set to "HTtb".  You might find it easier to make your own toolbar by modifying an existing one.  The Hotline client will use a toolbar when the file is in the same folder as the application.
  6.  
  7. The Toolbar file consists of "PICT" resources and one "HPTB" 128 resource.  First you need to make a picture ("PICT") of the entire toolbar — how it looks normally.  This picture should be the entire content of the Toolbar window.  It can be any rectangular shape.
  8.  
  9. Next, make individual PICTs of the areas of the toolbar that change when you click on them.  For example, if you have a button on your toolbar, the main picture of the entire toolbar shows the button unhilited — as it looks normally.  You then make a PICT that shows the button (and nothing else) hilited/depressed.
  10.  
  11. Once you've finished making your PICTs, copy them into the Toolbar file and assign them ID numbers.  PICT resources must have IDs in the range 1000 to 2000.  Use "Get Resource Info" under the "Resource" menu to change the IDs.  Mark all of the PICT resources as "purgeable", EXCEPT for the main background one.  Mark the main background PICT as "preload" and "locked".
  12.  
  13. Next, you need to make a "HPTB" resource.  This describes how the toolbar looks and works.  There is only one HPTB resource, and it is ID 128.  Do NOT make it purgeable.  In order to edit the HPTB resource, you need to have the TMPL (template) resource that describes the format of the HPTB resource.  To activate the template, either open Hotline and the Toolbar both in ResEdit at the same time, or copy the TMPL resource from Hotline to the Toolbar file.
  14.  
  15. The HPTB Resource Field-By-Field
  16.  
  17. "HPTB"
  18. Set this field to "HPTB".
  19.  
  20. Version1
  21. Set this field to 1.
  22.  
  23. sideTitleBar
  24. If this is set to 1, the titlebar on the toolbar window will appear vertically on the left side of the window.  If it is set to 0, it will appear at the top as normal.  A side titlebar is good for a window that is wider than it is high.
  25.  
  26. toggleWinVis
  27. If this is set to 1, the behavior for "showing" a window gets changed.  If the window is hidden, it is shown in front of all others.  If the window is visible, it is brought to the front.  If it was already at the front, it gets hidden (normally it stays visible).
  28.  
  29. (reserved)
  30. It is important that you leave these set to 0.
  31.  
  32. connectPict
  33. The ID of the PICT to draw when Hotline is connected (or 0 for none).
  34.  
  35. connectPictR
  36. The rectangle (top,left,bottom,right) in pixels to draw the "connectPict" at.
  37.  
  38. height
  39. The height of the window in pixels.
  40.  
  41. width
  42. The width of the window in pixels.
  43.  
  44. bkgndPict
  45. The ID of the PICT to draw as the background into the window.  This is the main picture — how the toolbar looks normally.
  46.  
  47. item bounds
  48. The rectangle (top,left,bottom,right) in pixels that encloses this item.  This rectangle is used to determine if the mouse is within the item, and is used to draw the "mDownPict" in the correct location.
  49.  
  50. item mDownPict
  51. The ID of the PICT to draw while mouse is down in this item (while the button on the mouse is pressed and located within the bounds of this item).
  52.  
  53. item mWithinPict
  54. The ID of the PICT to draw while mouse is in/over this item (while the mouse is located within the bounds of this item).
  55.  
  56. item mDownAction
  57. The action to perform when the mouse goes down in this item (when the button on the mouse is pressed and located within the bounds of this item).    See "Action Numbers" following for valid values.
  58.  
  59. item mUpAction
  60. The action to perform when the mouse is released in this item (when the button on the mouse was pressed and has just been released within the bounds of this item).  See "Action Numbers" following for valid values.
  61.  
  62. item mDownSound
  63. When the button on the mouse is pressed over this item, play the sound ("snd ") of this ID.  Note that if you add your own "snd " resources, the IDs must be in the range 1000 to 2000.
  64.  
  65. item mUpSound
  66. When the button on the mouse is released over this item, play the sound ("snd ") of this ID. Note that if you add your own "snd " resources, the IDs must be in the range 1000 to 2000.
  67.  
  68. item showPicInWin
  69. The ID of the PICT to show in a window with an OK button when this item is clicked.  Good for credits etc.
  70.  
  71. mDownPictRct
  72. Normally, the "mDownPict" gets drawn in the item bounds.  You can optionally specify a different rectangle here.
  73.  
  74. mWithinPictR
  75. Normally, the "mWithinPict" gets drawn in the item bounds.  You can optionally specify a different rectangle here.
  76.  
  77. Action Numbers
  78.  
  79. 0   = do nothing
  80. 1   = show options window
  81. 2   = show connect window
  82. 3   = disconnect
  83. 4   = show news window
  84. 5   = show post window
  85. 6   = show chat window
  86. 7   = show files window
  87. 8   = show user list window
  88. 9   = show tasks window
  89. 10  = quit
  90. 11  = show about window
  91. 12  = show new user window
  92. 13  = show open user window
  93. 15  = show tracker window
  94.  
  95. Making Faster Smaller PICTs
  96.  
  97. First you'll need GraphicConvertor.  You can get it from info-mac (eg, ftp://ftp.amug.org/info-mac/) or similiar.  Drag the ResEdit file containing the PICTs onto GraphicConvertor and it will let you choose which one you want to edit.
  98.  
  99. When you've got the picture open, choose "Minimise Color Table" from the "Picture" and then "Colors" menu.  This will not lessen the quality of your picture, but can make it smaller.  You may also want to lower the bit depth (eg, "Change to 256 Colors (8-bit)").  This might lessen the quality of your picture.
  100.  
  101. When you're done, choose "Save As" from the "File" menu.  Select "PICT in resource" as the format.  Click on "Options" and select "Standard (RLE)" as the compression (this is much faster to draw than QuickTime compression).  Save the PICT and open the file in ResEdit.  The PICT 128 resource is the one to use (if there's another, it's the preview). 
  102.  
  103.